//
//  WBDemoViewController.swift
//  Weibo
//
//  Created by niqiang on 16/7/2.
//  Copyright © 2016年 niqiang. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第\(navigationController?.childViewControllers.count ?? 0) 个"
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
//MARK: - 监听方法
    @objc private func showNext(){
    
        let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }

}

extension WBDemoViewController{

//重写父类方法
//    override func setupUI() {
//        super.setupUI()
    override func setupTableView() {
        super.setupTableView()
        
        // 设置右侧控制器
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个" , style:  .plain, target: self, action: #selector(showNext))
        
//        let btn: UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.darkGray(), highlightedColor: UIColor.orange())
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
        
    }
}
